<html>
<script>

var x = 2;

var f = function(y) {
	return x * y;
};

var x = 3;

var y = 2;

var z = f(x - y);
alert(z); 

</script>
</html>